package week6;

public abstract class AbstractPerson {
protected abstract int compare(Person p1,Person p2);
    public void sort(Person[] personArraw){
        for (int i=0;i<personArraw.length;i++){
            for(int j=i+1;j<personArraw.length;j++){
                if(compare(personArraw[i], personArraw[j])<0){
                    Person son=personArraw[i];
                    personArraw[i]=personArraw[j];
                    personArraw[j]=son;
                }
            }
        }
    }
}
